package cn.tt.core.constant;

import cn.tt.core.config.BootstrapProperties;
import cn.tt.core.util.spring.SpringContextHolder;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

/**
 * @Description 系统公共类，不参与业务
 * @Date 2017/7/28 22:51
 * @Since v1.7
 * @Autor Nick
 */
public class SysConstant {

	/**
	 * 日志对象
	 */
	private Logger logger = LoggerFactory.getLogger(getClass());

	/**
	 * 获取Key加载信息
	 */
	public final static void printLoadMessage() {
		StringBuilder loadString = new StringBuilder();
		BootstrapProperties properties = SpringContextHolder.getBean(BootstrapProperties.class);
		String productName = properties.getProductName();
		String author = properties.getAuthor();
//		PropertiesLoader propertiesLoader = new PropertiesLoader("/bootstrap.yml");
//		String productName = propertiesLoader.getProperty("cn.tt.productName");
//		String author = propertiesLoader.getProperty("cn.tt.author");

		loadString.append("\r\n======================================================================\r\n");
		loadString.append("\r\n             欢迎使用 " + productName + "    Power By " + author + "   \r\n");
		loadString.append("\r\n======================================================================\r\n");
		System.out.println(loadString.toString());
	}

}
